import {USER_ROLE, USER_ROLE_PAGE} from './api'
import {METHOD,req} from '@/utils/request'

export const page = async (params) => req(USER_ROLE_PAGE, METHOD.GET, params);

export const getById = async (params) => req(USER_ROLE, METHOD.GET, params);

export const save = async (params) => req(USER_ROLE, METHOD.POST, params);

export const edit = async (params) => req(USER_ROLE, METHOD.PUT, params);

export const remove = async (id) => req(`${USER_ROLE}/${id}`, METHOD.DELETE, null);

export const list = async () => req(`${USER_ROLE}/list`,METHOD.GET,null);

export default {
    page,
    getById,
    save,
    edit ,
    remove,
    list
}